<!--
 * @Author       : xiaowu wwl093000@163.com
 * @Date         : 2023-05-11 20:31:20
 * @LastEditTime : 2023-06-13 08:13:25
 * @LastEditors  : xiaowu wwl093000@163.com
 * @FilePath     : /erp-admin-ui/src/views/dashboard/ProcureGroup.vue
 * @Description  : -
-->
<template>
  <div class="procure-group">
    <el-row :gutter="32">
      <el-col :xs="24" :sm="24" :lg="24">
        <div class="procure-wrapper">
          <div class="procure-wrapper-content">
            <div class="group-itembox">
              <div class="group-item">
                <div class="card-procure">
                  <div class="card-procure-description">
                    <div class="card-procure-text">待采购</div>
                    <div class="card-procure-num">{{ dailData.daicaigou }}</div>
                  </div>
                </div>
              </div>
              <div class="group-item">
                <div class="card-procure">
                  <div class="card-procure-description">
                    <div class="card-procure-text">已采购</div>
                    <div class="card-procure-num">{{ dailData.yicaigou }}</div>
                  </div>
                </div>
              </div>
              <div class="group-item">
                <div class="card-procure">
                  <div class="card-procure-description">
                    <div class="card-procure-text">待同步</div>
                    <div class="card-procure-num">{{ dailData.daitongbu }}</div>
                  </div>
                </div>
              </div>
              <div class="group-item">
                <div class="card-procure">
                  <div class="card-procure-description">
                    <div class="card-procure-text">待截单</div>
                    <div class="card-procure-num">{{ dailData.daijiedan }}</div>
                  </div>
                </div>
              </div>
              <div class="group-item">
                <div class="card-procure">
                  <div class="card-procure-description">
                    <div class="card-procure-text">已完成</div>
                    <div class="card-procure-num">{{ dailData.yiwancheng }}</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import CountTo from 'vue-count-to'
import {
  ProcureDailData
} from "@/api/index/index"

export default {
  components: {
    CountTo
  },
  data() {
    return {
      dailData: {}
    }
  },
  created() {
    this.getProcureDailData();
  },
  methods: {
    // 实时数据
    getProcureDailData() {
      ProcureDailData().then(res => {
        this.dailData = res.data
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.procure-group {
  .procure-wrapper {
    background: #fff;
    padding: 20px 16px 0;
    margin-bottom: 32px;

    p {
      font-size: 16px;
      line-height: 18px;
      margin: 0 0 15px;
      color: #666;
    }

    .procure-wrapper-content {
      padding: 10px 0 30px;
    }
  }

  .group-itembox {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -16px;

    .group-item {
      width: calc(100% / 5);
      padding: 0 16px;
    }
  }

  .card-procure-col {
    margin-bottom: 32px;
  }

  .card-procure {
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);

    .card-procure-description {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: center;
      font-weight: bold;
      padding: 26px;

      .card-procure-text {
        line-height: 20px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 16px;
        margin-bottom: 10px;
      }

      .card-procure-num {
        font-size: 20px;
        line-height: 20px;
      }
    }
  }

  .card-procure-item {
    height: 200px;
  }

  .card-procure-item-padding {
    padding: 0 30px;
  }

  .card-procure-textbold {
    font-size: 26px;
    font-weight: bold;
  }

  .card-procure-text300 {
    font-size: 24px;
  }

  .card-procure-button {
    flex: 1;
    padding-left: 80px;

    .button-item {
      display: inline-block;
      line-height: 40px;
      font-size: 20px;
      color: #36a3f7;
      padding: 0 15px;
      margin: 0 5px;
      cursor: pointer;
      border-radius: 6px;

      &:hover {
        background: #36a3f7;
        color: #fff;
      }
    }
  }

  .fontSize16 {
    font-size: 16px;
    line-height: 18px;
  }

  .card-procure-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .card-procure-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .card-procure-flex-column {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
  }
}

@media (max-width:550px) {
  .card-procure-description {
    display: none;
  }

  .card-procure-icon-wrapper {
    float: none !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;

    .svg-icon {
      display: block;
      margin: 14px auto !important;
      float: none !important;
    }
  }
}
</style>